package com.haoshuang.zhouzhoubang.ui.page.shop.car

import com.chad.library.adapter4.BaseQuickAdapter
import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemShopingCarBinding
import com.haoshuang.zhouzhoubang.model.bean.ShopBean5
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.load


/**
 * 订单模块中的订单列表适配器
 * */
class ShopCarAdapter(data: MutableList<ShopBean5>) :
    BaseBindingQuickAdapter<ShopBean5, ItemShopingCarBinding>(data){

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: ShopBean5?) {
        val binding = ItemShopingCarBinding.bind(holder.itemView)
        binding.apply {
            ivOrderGoodsImage.load(item?.image, R.mipmap.default_image)
            tvOrderGoodsName.text=item?.store_name
            tvNum2.text=item?.cart_num.toString()
            tvOrderGoodsPrice.text="¥"+item?.price
            if (item?.isCheck==1){
                ivCheck.setImageResource(R.mipmap.dz_ok)
            }else{
                ivCheck.setImageResource(R.mipmap.dz_wx)
            }

            tvSpec.text = item?.select_spec
        }
    }

}